﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MongoServices
{
	/// <summary>
	/// The base MongoServices service.
	/// </summary>
	/// <typeparam name="T">The MongoServices model to be used by this service.</typeparam>
	public abstract class MongoServicesService<T> : IMongoServicesService<T>
		where T : MongoServicesModel
	{
		#region Protected Properties
		/// <summary>
		/// Gets the <see cref="IMongoServicesRepository&lt;T&gt;"/> that was passed into the constructor.
		/// </summary>
		protected IMongoServicesRepository<T> MongoServicesRepository { get; private set; }
		#endregion

		#region Internal Properties
		internal static ServiceConfigContainer<MongoServicesService<T>, T> ServiceConfig
		{
			get
			{
				return ServiceConfigContainer<MongoServicesService<T>, T>.Instance;
			}
		}
		#endregion

		#region Public Constructors
		/// <summary>
		/// Constructs a MongoServicesService based on the <c>mongoServicesRepository</c> parameter.
		/// </summary>
		/// <param name="mongoServicesRepository">The <see cref="IMongoServicesService&lt;T&gt;"/> to be used with this service.</param>
		public MongoServicesService(IMongoServicesRepository<T> mongoServicesRepository)
		{
			MongoServicesRepository = mongoServicesRepository;
		}
		#endregion
	}
}
